-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tangle-dapp): Bridge revamp & Router integration #2698
Conversation
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions that can be improved
import { BridgeChainsConfigType, BridgeTokenType } from './types'; | ||
import { Abi } from 'viem'; | ||
|
||
const asAbi = (abi: any): Abi => abi as Abi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to avoid using any here? Does it show you an error otherwise?
const routerQuoteParams = { | ||
fromTokenAddress, | ||
toTokenAddress, | ||
amountInWei: amount?.toString() ?? '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen in the case that the amount is an empty string?
amount: Number(amount?.toString() ?? '0'), | ||
sourceTypedChainId, | ||
destinationTypedChainId, | ||
senderAddress: activeAccount?.address ?? '', | ||
recipientAddress: destinationAddress ?? '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen when the amount is zero or the addresses are empty strings? Should we be handling these edge cases explicitly instead?
} | ||
|
||
export type RouterTransferProps = { | ||
routerQuoteData: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there are structured data type for this?
@@ -81,7 +82,9 @@ export type LocalStorageValueOf<T extends LocalStorageKey> = | |||
? LiquidStakingTableData | |||
: T extends LocalStorageKey.ONBOARDING_MODALS_SEEN | |||
? OnboardingPageKey[] | |||
: never; | |||
: T extends LocalStorageKey.EVM_TOKEN_BALANCES | |||
? Record<string, any> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any structured data type for this?
Summary of changes
Proposed area of change
apps/tangle-dapp
apps/tangle-cloud
libs/tangle-shared-ui
libs/webb-ui-components